package com.example.intent;

import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import static java.lang.Thread.sleep;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                    SharedPreferences s = Myutil.getSharedPre();
                    SharedPreferences.Editor edits = s.edit();//获取编辑器
                    edits.putBoolean("wel", true);//一旦设为true  下次进入就不会到引导页面
                    edits.commit();
                    Intent intent=new Intent(MainActivity.this,firstactivity.class);
                    startActivity(intent);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();

    }
}
